package com.ljm.common.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Map;

/**
 * spirngmvc 统一返回结果集
 *
 * @author ming
 */
@Data
@ApiModel("通用响应结构体")
public class BaseResult {
    /**
     * 200：成功，500：错误
     */
    @ApiModelProperty(value = "响应状态")
    private String status;
    /**
     * 提示消息
     */
    @ApiModelProperty(value = "响应消息")
    private String message;
    /**
     * 数据
     */
    private Object data;
    /**
     * 调用链id
     */
    private String traceId;

    /**
     * 拓展数据
     */
    private Map<String,Object> extData;

    public BaseResult(String status, String message, Object data) {
        this.status = status;
        this.message = message;
        this.data = data;
    }
}
